home *** CD-ROM | disk | FTP | other *** search
- global gQList
-
- on getQuadBase which
- set q to getAt(gQList, which)
- return getaProp(q, #base)
- end
-
- on initQuads
- global gCurQuad, gNexQuad
- set gQList to []
- repeat with i = 1 to 2
- add(gQList, [#base: 449 + ((i - 1) * 4), #page: i, #index: 0, #unit: 0, #chapter: 0])
- end repeat
- set gCurQuad to 1
- set gNexQuad to 2
- end
-
- on ChangeQuadPtr
- global gCurQuad, gNexQuad
- set temp to gCurQuad
- set gCurQuad to gNexQuad
- set gNexQuad to temp
- end
-
- on isQuadPageThis which, theUnit, theChap, thePage
- set q to getAt(gQList, which)
- set p to getaProp(q, #page)
- set u to getaProp(q, #unit)
- set c to getaProp(q, #chapter)
- if (theUnit = u) and (theChap = c) and (thePage = p) then
- return 1
- else
- return 0
- end if
- end
-
- on newPage which, theUnit, theChap, thePage
- if isQuadPageThis(which, theUnit, theChap, thePage) = 0 then
- set q to getAt(gQList, which)
- setaProp(q, #unit, theUnit)
- setaProp(q, #chapter, theChap)
- setaProp(q, #page, thePage)
- setaProp(q, #index, 0)
- end if
- end
-
- on getPict which
- global gPathList, gCurQuad, gNexQuad, gPatch, gNextPathList, gEsPatch
- set ret to 1
- if pictMode() <> #notUsed then
- if which then
- set q to getAt(gQList, gCurQuad)
- set thePath to gPathList
- else
- set q to getAt(gQList, gNexQuad)
- set thePath to gNextPathList
- end if
- if getaProp(q, #index) < 4 then
- setaProp(q, #index, getaProp(q, #index) + 1)
- set index to getaProp(q, #index) + ((getaProp(q, #page) - 1) * 4)
- if gPatch and (index = 36) then
- set the picture of cast (getaProp(q, #base) + getaProp(q, #index) - 1) to the picture of cast 447
- else
- if gEsPatch and (index = 18) then
- set the picture of cast (getaProp(q, #base) + getaProp(q, #index) - 1) to the picture of cast "ES031018.PCT"
- else
- set fname to makeImagePath(thePath, #PICT, index)
- set fcast to getaProp(q, #base) + getaProp(q, #index) - 1
- set the fileName of cast fcast to fname
- preLoadCast(fcast)
- end if
- end if
- end if
- end if
- return ret
- end
-
- on checkLoad
- global gCurQuad, gPage, gNewChap
- set q to getAt(gQList, gCurQuad)
- if isQuadPageThis(gCurQuad, ChapStr2Unit(gNewChap), ChapStr2Chap(gNewChap), gPage) = 0 then
- ChangeQuadPtr()
- newPage(gCurQuad, ChapStr2Unit(gNewChap), ChapStr2Chap(gNewChap), gPage)
- set q to getAt(gQList, gCurQuad)
- end if
- set curIndex to getaProp(q, #index)
- if curIndex < 4 then
- repeat with i = curIndex + 1 to 4
- getPict(1)
- end repeat
- end if
- end
-